//
// Created by bing on 2021/7/10.
//

#ifndef CPP_VIRTUALFUNCTIONDEMO_H
#define CPP_VIRTUALFUNCTIONDEMO_H

#include <iostream>

using namespace std;

class VirtualFunctionDemo {
public:
    static int main();
};


class Person {
public:
    string name;

    Person(string name) : name(name) {}

    virtual void hello();
};

class Student : public Person {
public:
    string school;

    void hello();

    Student(string name, string school) : Person(name), school(school) {}
};

class CollegeStudent : public Student {
public:
    string girlFriend;

    void hello();

    CollegeStudent(string name, string school, string girlFriend) : Student(name, school), girlFriend(girlFriend) {}
};


#endif //CPP_VIRTUALFUNCTIONDEMO_H
